
Imports System.Data.SqlClient
Imports ModuloAdministraciondeEnvios.PresentationLayer

Public Class FrmBuscarClientes

    Private Sub FrmBuscarClientes_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        StringComando = "SELECT Cliente.IDCliente, Cliente.Nombre, Cliente.Domicilio, Cliente.CUIT, Localidad.Nombre AS Expr1, Localidad.CodigoPostal "
        StringComando += "FROM Cliente INNER JOIN Localidad ON Cliente.Localidad = Localidad.IDLocalidad"

        Dim Conecta As New SqlConnection(StringConecta)
        Conecta.Open()
        Comando = New SqlCommand(StringComando, Conecta)


        Adapter = New SqlDataAdapter(StringComando, Conecta)
        Ds = New DataSet
        Adapter.Fill(Ds, "Clientes")

        DataGridViewClientes.DataSource = Ds.Tables("Clientes")


        Conecta.Close()
        Conecta.Dispose()

        TextBox1.Modified = False




    End Sub

    Private Sub DataGridViewClientes_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridViewClientes.CellDoubleClick

        ValorSeleccionado = Ds.Tables("Clientes").Rows(e.RowIndex).Item(0)
        FrmEnvios.TextBoxOrigenID.Text = ValorSeleccionado
        Me.Close()


    End Sub

    Private Sub DataGridViewClientes_CellContentClick_1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridViewClientes.CellContentClick

    End Sub
End Class